var prefService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).QueryInterface(Components.interfaces.nsIPrefBranch2);
var prefService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).QueryInterface(Components.interfaces.nsIPrefBranch2);
var items = styles.getElementsByTagName("richlistitem")
var index;
for (index = 0; index < items.length; index++) {
if (items[index] == currentSelection) {
break;
}
}
function move() {
if (event.keyCode == 38) {
if (index == 0) {
return false;
}
index--;
} else {
if (index == items.length - 1) {
return false;
}
index++;
}
return true;
}
while(move()) {
var item = items[index];
// skip over items in collapsed containers
if (item.parentNode.nodeName != "style-container" || item.parentNode.getAttribute("closed") != "true") {
nextSelection = item;
break;
}
}
}
if (nextSelection) {
nextSelection.click();
styles.ensureElementIsVisible(nextSelection);
}
},
// workaround for bug 115296
loadUIState: function() {
var prefService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).QueryInterface(Components.interfaces.nsIPrefBranch2);
var prefService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).QueryInterface(Components.interfaces.nsIPrefBranch2);
// We can't just create a new list of ids of things that are closed because the user may have switched
// grouping and we wouldn't want to lose all their settings from the other grouping.
var ids = [];
// Check things that were closed last time, and remove them if they're open.